Optimal. Leaf size=110 \[ 4 a^3 (c-i d) x-\frac {4 a^3 (i c+d) \log (\cos (e+f x))}{f}-\frac {2 a^3 (c-i d) \tan (e+f x)}{f}+\frac {a (i c+d) (a+i a \tan (e+f x))^2}{2 f}+\frac {d (a+i a \tan (e+f x))^3}{3 f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 110, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {3608, 3559,
3558, 3556} \begin {gather*} -\frac {2 a^3 (c-i d) \tan (e+f x)}{f}-\frac {4 a^3 (d+i c) \log (\cos (e+f x))}{f}+4 a^3 x (c-i d)+\frac {a (d+i c) (a+i a \tan (e+f x))^2}{2 f}+\frac {d (a+i a \tan (e+f x))^3}{3 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3556
Rule 3558
Rule 3559
Rule 3608
Rubi steps
\begin {align*} \int (a+i a \tan (e+f x))^3 (c+d \tan (e+f x)) \, dx &=\frac {d (a+i a \tan (e+f x))^3}{3 f}-(-c+i d) \int (a+i a \tan (e+f x))^3 \, dx\\ &=\frac {a (i c+d) (a+i a \tan (e+f x))^2}{2 f}+\frac {d (a+i a \tan (e+f x))^3}{3 f}+(2 a (c-i d)) \int (a+i a \tan (e+f x))^2 \, dx\\ &=4 a^3 (c-i d) x-\frac {2 a^3 (c-i d) \tan (e+f x)}{f}+\frac {a (i c+d) (a+i a \tan (e+f x))^2}{2 f}+\frac {d (a+i a \tan (e+f x))^3}{3 f}+\left (4 a^3 (i c+d)\right ) \int \tan (e+f x) \, dx\\ &=4 a^3 (c-i d) x-\frac {4 a^3 (i c+d) \log (\cos (e+f x))}{f}-\frac {2 a^3 (c-i d) \tan (e+f x)}{f}+\frac {a (i c+d) (a+i a \tan (e+f x))^2}{2 f}+\frac {d (a+i a \tan (e+f x))^3}{3 f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice
the leaf count of optimal. \(331\) vs. \(2(110)=220\).
time = 3.40, size = 331, normalized size = 3.01 \begin {gather*} \frac {a^3 \sec (e) \sec ^3(e+f x) \left (6 c f x \cos (2 e+3 f x)-6 i d f x \cos (2 e+3 f x)+6 c f x \cos (4 e+3 f x)-6 i d f x \cos (4 e+3 f x)-3 i c \cos (2 e+3 f x) \log \left (\cos ^2(e+f x)\right )-3 d \cos (2 e+3 f x) \log \left (\cos ^2(e+f x)\right )-3 i c \cos (4 e+3 f x) \log \left (\cos ^2(e+f x)\right )-3 d \cos (4 e+3 f x) \log \left (\cos ^2(e+f x)\right )+3 \cos (f x) \left (-i c-3 d+6 c f x-6 i d f x+(-3 i c-3 d) \log \left (\cos ^2(e+f x)\right )\right )+3 \cos (2 e+f x) \left (-i c-3 d+6 c f x-6 i d f x+(-3 i c-3 d) \log \left (\cos ^2(e+f x)\right )\right )-18 c \sin (f x)+24 i d \sin (f x)+9 c \sin (2 e+f x)-15 i d \sin (2 e+f x)-9 c \sin (2 e+3 f x)+13 i d \sin (2 e+3 f x)\right )}{12 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.12, size = 100, normalized size = 0.91
method | result | size |
derivativedivides | \(\frac {a^{3} \left (-\frac {i d \left (\tan ^{3}\left (f x +e \right )\right )}{3}-\frac {i c \left (\tan ^{2}\left (f x +e \right )\right )}{2}+4 i \tan \left (f x +e \right ) d -\frac {3 d \left (\tan ^{2}\left (f x +e \right )\right )}{2}-3 c \tan \left (f x +e \right )+\frac {\left (4 i c +4 d \right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}+\left (-4 i d +4 c \right ) \arctan \left (\tan \left (f x +e \right )\right )\right )}{f}\) | \(100\) |
default | \(\frac {a^{3} \left (-\frac {i d \left (\tan ^{3}\left (f x +e \right )\right )}{3}-\frac {i c \left (\tan ^{2}\left (f x +e \right )\right )}{2}+4 i \tan \left (f x +e \right ) d -\frac {3 d \left (\tan ^{2}\left (f x +e \right )\right )}{2}-3 c \tan \left (f x +e \right )+\frac {\left (4 i c +4 d \right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}+\left (-4 i d +4 c \right ) \arctan \left (\tan \left (f x +e \right )\right )\right )}{f}\) | \(100\) |
norman | \(\left (-4 i a^{3} d +4 a^{3} c \right ) x -\frac {\left (i a^{3} c +3 a^{3} d \right ) \left (\tan ^{2}\left (f x +e \right )\right )}{2 f}-\frac {\left (-4 i a^{3} d +3 a^{3} c \right ) \tan \left (f x +e \right )}{f}-\frac {i a^{3} d \left (\tan ^{3}\left (f x +e \right )\right )}{3 f}+\frac {2 \left (i a^{3} c +a^{3} d \right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{f}\) | \(117\) |
risch | \(\frac {8 i a^{3} d e}{f}-\frac {8 a^{3} c e}{f}-\frac {2 a^{3} \left (12 i c \,{\mathrm e}^{4 i \left (f x +e \right )}+24 d \,{\mathrm e}^{4 i \left (f x +e \right )}+21 i c \,{\mathrm e}^{2 i \left (f x +e \right )}+33 \,{\mathrm e}^{2 i \left (f x +e \right )} d +9 i c +13 d \right )}{3 f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{3}}-\frac {4 a^{3} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) d}{f}-\frac {4 i a^{3} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) c}{f}\) | \(145\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.51, size = 114, normalized size = 1.04 \begin {gather*} -\frac {2 i \, a^{3} d \tan \left (f x + e\right )^{3} + 3 \, {\left (i \, a^{3} c + 3 \, a^{3} d\right )} \tan \left (f x + e\right )^{2} - 24 \, {\left (a^{3} c - i \, a^{3} d\right )} {\left (f x + e\right )} + 12 \, {\left (-i \, a^{3} c - a^{3} d\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right ) + 6 \, {\left (3 \, a^{3} c - 4 i \, a^{3} d\right )} \tan \left (f x + e\right )}{6 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 205 vs. \(2 (98) = 196\).
time = 0.96, size = 205, normalized size = 1.86 \begin {gather*} -\frac {2 \, {\left (9 i \, a^{3} c + 13 \, a^{3} d + 12 \, {\left (i \, a^{3} c + 2 \, a^{3} d\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + 3 \, {\left (7 i \, a^{3} c + 11 \, a^{3} d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + 6 \, {\left (i \, a^{3} c + a^{3} d + {\left (i \, a^{3} c + a^{3} d\right )} e^{\left (6 i \, f x + 6 i \, e\right )} + 3 \, {\left (i \, a^{3} c + a^{3} d\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + 3 \, {\left (i \, a^{3} c + a^{3} d\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right )\right )}}{3 \, {\left (f e^{\left (6 i \, f x + 6 i \, e\right )} + 3 \, f e^{\left (4 i \, f x + 4 i \, e\right )} + 3 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.39, size = 184, normalized size = 1.67 \begin {gather*} - \frac {4 i a^{3} \left (c - i d\right ) \log {\left (e^{2 i f x} + e^{- 2 i e} \right )}}{f} + \frac {- 18 i a^{3} c - 26 a^{3} d + \left (- 42 i a^{3} c e^{2 i e} - 66 a^{3} d e^{2 i e}\right ) e^{2 i f x} + \left (- 24 i a^{3} c e^{4 i e} - 48 a^{3} d e^{4 i e}\right ) e^{4 i f x}}{3 f e^{6 i e} e^{6 i f x} + 9 f e^{4 i e} e^{4 i f x} + 9 f e^{2 i e} e^{2 i f x} + 3 f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 333 vs. \(2 (98) = 196\).
time = 0.60, size = 333, normalized size = 3.03 \begin {gather*} -\frac {2 \, {\left (6 i \, a^{3} c e^{\left (6 i \, f x + 6 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) + 6 \, a^{3} d e^{\left (6 i \, f x + 6 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) + 18 i \, a^{3} c e^{\left (4 i \, f x + 4 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) + 18 \, a^{3} d e^{\left (4 i \, f x + 4 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) + 18 i \, a^{3} c e^{\left (2 i \, f x + 2 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) + 18 \, a^{3} d e^{\left (2 i \, f x + 2 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) + 12 i \, a^{3} c e^{\left (4 i \, f x + 4 i \, e\right )} + 24 \, a^{3} d e^{\left (4 i \, f x + 4 i \, e\right )} + 21 i \, a^{3} c e^{\left (2 i \, f x + 2 i \, e\right )} + 33 \, a^{3} d e^{\left (2 i \, f x + 2 i \, e\right )} + 6 i \, a^{3} c \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) + 6 \, a^{3} d \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) + 9 i \, a^{3} c + 13 \, a^{3} d\right )}}{3 \, {\left (f e^{\left (6 i \, f x + 6 i \, e\right )} + 3 \, f e^{\left (4 i \, f x + 4 i \, e\right )} + 3 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 5.42, size = 125, normalized size = 1.14 \begin {gather*} \frac {\mathrm {tan}\left (e+f\,x\right )\,\left (-a^3\,\left (2\,c-d\,1{}\mathrm {i}\right )+a^3\,\left (2\,d+c\,1{}\mathrm {i}\right )\,1{}\mathrm {i}+a^3\,d\,1{}\mathrm {i}\right )}{f}+\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,\left (4\,a^3\,d+a^3\,c\,4{}\mathrm {i}\right )}{f}-\frac {{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (\frac {a^3\,\left (2\,d+c\,1{}\mathrm {i}\right )}{2}+\frac {a^3\,d}{2}\right )}{f}-\frac {a^3\,d\,{\mathrm {tan}\left (e+f\,x\right )}^3\,1{}\mathrm {i}}{3\,f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________